package com.apartment.dao;


import com.apartment.data.entity.Landlord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * Author : xuzhiyong
 * Date : 2022/5/31 15:06
 */
public interface LandlordDao extends JpaRepository<Landlord, Integer> {

//    @Query(value = "select l.landlord_username,l.password from Landlord l where l.landlord_username like ?1 and l.password like ?2",nativeQuery = true)
    Landlord findByUsernameAndPassword(String landlord_username,String password);

    @Query(value = "select l.id,l.landlord_username,l.password,l.phone,l.sex from Landlord l where l.landlord_username like ?1",nativeQuery = true)
    Landlord findLandlordByUsername(String landlord_username);
    @Query(value = "select * from Landlord l where l.mail like ?1",nativeQuery = true)
    Landlord findLandlordByMail(String mail);
}
